package work.huangxin.share.service;

import com.github.pagehelper.PageInfo;
import org.eclipse.jdt.internal.compiler.env.IModule;
import org.springframework.stereotype.Service;
import work.huangxin.share.basemapper.SameService;
import work.huangxin.share.domain.sechand.SechandBuyGoods;
import work.huangxin.share.domain.sechand.SechandGoods;

import java.util.List;

/**
* @author 钟声浩
* @date 2023/3/25 21:57
*/
public interface SechandBuyGoodsService{



    /**
     * 分页展示所有的求购商品
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo<SechandBuyGoods> selectPageSechandBuyGoodsList(Integer pageNum, Integer pageSize);

    /**
     * 用户查询自己发布的求购商品
     * @param userId
     * @return
     */
    List<SechandBuyGoods> selectSechandBuyGoodsByUserId(Integer userId);

    /**
     * 根据商品id查询详细信息
     * @param id
     * @return
     */
    SechandBuyGoods selectSechandBuyGoodsById(Integer id);

    /**
     * 更新自己求购的商品信息
     * @param sechandBuyGoods
     * @return
     */
    int updateBuyGoods(SechandBuyGoods sechandBuyGoods);


    /**
     * 根据关键字搜索求购商品
     * @param keyword
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo<SechandBuyGoods> getBuyGoodsByKeyWord(String keyword, Integer pageNum, Integer pageSize);

    /**
     * 删除求购商品
     * @param userId
     * @param goodsId
     * @return
     */
    int deleteBuyGoods(Integer userId, Integer goodsId);

    /**
     * 下架求购商品
     * @param userId
     * @param goodsId
     * @return
     */
    int setBuyGoodsIsBuied(Integer userId, Integer goodsId);

    int deleteBuyGoodsByAdmin(Integer goodsId, Integer hasBuied);

    int insertSechandBuyGoods(SechandBuyGoods sechandBuyGoods);

    int updateSechandGoods(SechandBuyGoods sechandBuyGoods);

    int deletedBuyGoods(Integer goodsId);
}
